package com.njit.mailm.core.dao;

import com.njit.mailm.core.bean.Email;
import com.njit.mailm.core.bean.MessageWrap;
import com.njit.mailm.core.bean.Page;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * Created by Administrator on 2016/4/9.
 */
public interface ManagerDao {
    /**
     * 批量将邮件的isDelete字段设置成1
     * @param ids 邮箱id数组
     */
    void deleteMessageById(@Param("ids")String[] ids);

    /**
     * 批量设置邮件已读或未读
     * @param ids 邮件id数组
     * @param isread true对应邮件目前状态为已读，要将其设置成未读，false为当前状态为未读，要将其设置成已读
     */
    void setReadById(@Param("ids")String[] ids,@Param("isread")boolean isread);

    List<MessageWrap> selectMessageFromTrash(String id);

    int getTotalMessageNumber(String emailAccount);

    int getDeleteNumber(Email email);

    List<MessageWrap> pageListStar(Page p, Email email);

    int getStarTotal(Email email);

    void setStar(@Param("setStar") boolean setStar, @Param("id") String id);

    List<MessageWrap> pageListTrash(Page p, Email email);

    int getTrashTotal(Email email);
}
